﻿
var status = 0;
var eff = "#fUI/UIWindow.img/PvP/Scroll/enabled/next2#";
var z = "#fUI/UIWindow/Quest/icon5/1#";//"+z+"//美化
var kkk = "#fUI/CashShop.img/CSBeauty/eyeColor/Enable/1#"//"#fMap/MapHelper.img/weather/starPlanet/6#"; //"#fEffect/CharacterEff/1051296/1/0#";
var eff1 = "#fEffect/CharacterEff/1112905/0/1#";//小红心
var icon = "#fUI/Basic.img/BtMin2/normal/0#";
var iconEvent = "#fUI/UIToolTip.img/Item/Equip/Star/Star#";
var ttt = "#fUI/UIWindow/Quest/icon2/7#";//"+ttt+"//美化1
var ttt2 = "#fUI/UIWindow/Quest/icon6/7#";////美化2
var ttt3 = "#fUI/UIWindow/Quest/icon3/6#";//"+ttt3+"//美化圆
var ttt4 = "#fUI/UIWindow/Quest/icon5/1#";//"+ttt4+"//美化New
var ttt5 = "#fUI/UIWindow/Quest/icon0#";////美化!
var ttt6 = "#fUI/UIWindow.img/PvP/Scroll/enabled/next2#";//"+ttt6+"//美化会员
var z1 = "#fUI/UIWindow.img/PvP/Scroll/enabled/next2#";//"+z+"//美化
var tt = "#fEffect/ItemEff/1112811/0/0#";//音符
var xm1 ="#fEffect/SetEff.img/245/effect/28#";// 
var ba1 ="#fEffect/SetEff.img/161/effect/3#";//
var hh2 ="#fCharacter/Accessory/01012139.img/default/default#";//  
var wn24 = "#fUI/CashShop.img/CSEffect/time/0#";  //限量图标
var wn20 = "#fUI/CashShop.img/CSEffect/hot/0#";  //人气图标
var aek1 = "#fItem/Pet/5000331.img/hungry/3#";//忧伤
var aek2 = "#fItem/Pet/5000331.img/cry/5#";//生气
var aek3 = "#fItem/Pet/5000331.img/dung/2#";//蹲厕所
var aek4 = "#fItem/Pet/5000331.img/sleep/2#";//睡觉
var sw1 = "#fItem/Pet/5000415.img/hungry/3#";//忧伤
var sw2 = "#fItem/Pet/5000415.img/cry/5#";//生气
var sw3 = "#fItem/Pet/5000415.img/dung/2#";//蹲厕所
var sw4 = "#fItem/Pet/5000415.img/sleep/2#";//睡觉
var ttt7 ="#fMap/MapHelper.img/weather/2011Xmas/6#";//
var gg2 ="#fUI/UIPVP.img/ChampionMark/4#"; //
var gg3 ="#fUI/UIPVP.img/MiniMapIcon/star#";

var feng = "#v4032733#"
var jf = 100;//兑换数量
var ltz43 =  "#fCharacter/Weapon/01702523.img/48/straight/0/effect#"; //

function start() {
    status = -1;
    action(1, 0, 0);
}

function action(mode, type, selection) {
    if (status == 0 && mode == 0) {
        cm.dispose();
        return;
    }
    if (mode == 1) {
        status++;
    } else {
        status--;
    }
    if (cm.getMapId() == 180000001) {
            cm.sendOk("很遗憾，您因为违反用户守则被禁止游戏活动，如有异议请联系管理员.")
            cm.dispose();
        } 
    else if (status == 0) { //
		var selStr = "#e#r   "+gg2+" BOSS 通关时间排行榜 "+gg2+" #n#k#n#k\r\n";//""+ttt+" #e#d请选择#k#n\r\n"+ltz43+"#r福利中心#k"+ltz43+"\r\n";//+eff1+""+eff1+""+eff1+""+eff1+""+eff1+""+eff1+""+eff1+""+eff1+""+eff1+""+eff1+""+eff1+""+eff1+""+eff1+""+eff1+""+eff1+""+eff1+""+eff1+""+eff1+""+eff1+""+eff1+""+eff1+""+eff1+""+eff1+""+eff1+""+eff1+""+eff1+""+eff1+""+eff1+""+eff1+"\r\n";
		//selStr += "  "+hh2+""+hh2+""+hh2+""+hh2+""+hh2+""+hh2+""+hh2+""+hh2+""+hh2+""+hh2+""+hh2+""+hh2+""+hh2+""+hh2+""+hh2+""+hh2+""+hh2+""+hh2+""+hh2+""+hh2+""+hh2+""+hh2+""+hh2+""+hh2+""+hh2+""+hh2+""+hh2+""+hh2+""+hh2+""+hh2+""+hh2+""+hh2+""+hh2+""+hh2+"\r\n";
		selStr += "#d #L0#"+gg3+" 近期所有BOSS通关名单#l\r\n";
		selStr += "#d #L1#"+gg3+" 单人模式[困难麦格纳斯]排名#l\r\n";
		selStr += "#d #L2#"+gg3+" 单人模式[进阶半半]排名#l\r\n";
		selStr += "#d #L3#"+gg3+" 单人模式[进阶皮埃尔]排名#l\r\n";
		selStr += "#d #L4#"+gg3+" 单人模式[进阶血腥女王]排名#l\r\n";
		selStr += "#d #L5#"+gg3+" 单人模式[进阶贝伦]排名#l\r\n";
		selStr += "#d #L6#"+gg3+" 单人模式[普通斯乌]排名#l\r\n";
		selStr += "#d #L7#"+gg3+" 单人模式[戴米安]排名#l\r\n";
		selStr += "#r #L11#"+gg3+" 组队模式[困难麦格纳斯]排名#l\r\n";
		selStr += "#r #L12#"+gg3+" 组队模式[进阶半半]排名#l\r\n";
		selStr += "#r #L13#"+gg3+" 组队模式[进阶皮埃尔]排名#l\r\n";
		selStr += "#r #L14#"+gg3+" 组队模式[进阶血腥女王]排名#l\r\n";
		selStr += "#r #L15#"+gg3+" 组队模式[进阶贝伦]排名#l\r\n";
		selStr += "#r #L16#"+gg3+" 组队模式[普通斯乌]排名#l\r\n";
		selStr += "#r #L17#"+gg3+" 组队模式[戴米安]排名#l\r\n";
		//selStr += "#e#r \t"+sw1+"     "+sw2+"    "+sw3+"    "+sw4+"#n#k#n#k\r\n";//"  "+hh2+""+hh2+""+hh2+""+hh2+""+hh2+""+hh2+""+hh2+""+hh2+""+hh2+""+hh2+""+hh2+""+hh2+""+hh2+""+hh2+""+hh2+""+hh2+""+hh2+""+hh2+""+hh2+""+hh2+""+hh2+""+hh2+""+hh2+""+hh2+""+hh2+""+hh2+""+hh2+""+hh2+""+hh2+""+hh2+""+hh2+""+hh2+""+hh2+""+hh2+"\r\n";
		//selStr += "\r\n"+eff1+""+eff1+""+eff1+""+eff1+""+eff1+""+eff1+""+eff1+""+eff1+""+eff1+""+eff1+""+eff1+""+eff1+""+eff1+""+eff1+""+eff1+""+eff1+""+eff1+""+eff1+""+eff1+""+eff1+""+eff1+""+eff1+""+eff1+""+eff1+""+eff1+""+eff1+""+eff1+""+eff1+""+eff1+"\r\n";
		//selStr += "\r\n\t\t\t#b#L9#"+ttt+" 返回上一页#l#k\r\n";
		cm.sendSimple(selStr);
    } else if (status == 1) {
        switch (selection) {
        case 0: // 在线福利
			var log = cm.getConnection().prepareStatement("SELECT * FROM BossJiShi ORDER BY id DESC LIMIT 100").executeQuery();
    var text = ""
    var i = 1;
    text += "#d#e近期所有BOSS挑战名单（最近100条）#k\r\n---------------------------------------------\r\n"
    while (log.next()) {
        text += "#fUI/UIToolTip.img/Item/Equip/Star/Star# #r" + log.getString("charname") + "#k 打败 #b" + log.getString("bossname") + "#k 使用了 " + log.getString("shijian") + "秒。"
        text += "\r\n"
        i++;
    }
    text += "----------------------------------------------\r\n";
	cm.sendOk(text);
    cm.dispose();
			break;
		case 1: // 每日签到
		var log = cm.getConnection().prepareStatement("SELECT * FROM BossJiShi where bossid = 11 ORDER BY shijian LIMIT 10").executeQuery();
    var text = ""
    var i = 1;
    text += "#d#e单人模式[困难麦格纳斯]挑战名单（用时最少前10条）#k\r\n---------------------------------------------\r\n"
    while (log.next()) {
        text += "#fUI/UIToolTip.img/Item/Equip/Star/Star# #r" + log.getString("charname") + "#k 打败 #b" + log.getString("bossname") + "#k 使用了 " + log.getString("shijian") + "秒。"
        text += "\r\n"
        i++;
    }
    text += "----------------------------------------------\r\n";
	cm.sendOk(text);
    cm.dispose();
					break;
		case 2: // 每日道具
		var log = cm.getConnection().prepareStatement("SELECT * FROM BossJiShi where bossid = 12 ORDER BY shijian LIMIT 10").executeQuery();
    var text = ""
    var i = 1;
    text += "#d#e单人模式[进阶半半]挑战名单（用时最少前10条）#k\r\n---------------------------------------------\r\n"
    while (log.next()) {
        text += "#fUI/UIToolTip.img/Item/Equip/Star/Star# #r" + log.getString("charname") + "#k 打败 #b" + log.getString("bossname") + "#k 使用了 " + log.getString("shijian") + "秒。"
        text += "\r\n"
        i++;
    }
    text += "----------------------------------------------\r\n";
	cm.sendOk(text);
    cm.dispose();
					break;
		case 3: //  等级奖励
		var log = cm.getConnection().prepareStatement("SELECT * FROM BossJiShi where bossid = 13 ORDER BY shijian LIMIT 10").executeQuery();
    var text = ""
    var i = 1;
    text += "#d#e单人模式[进阶皮埃尔]挑战名单（用时最少前10条）#k\r\n---------------------------------------------\r\n"
    while (log.next()) {
        text += "#fUI/UIToolTip.img/Item/Equip/Star/Star# #r" + log.getString("charname") + "#k 打败 #b" + log.getString("bossname") + "#k 使用了 " + log.getString("shijian") + "秒。"
        text += "\r\n"
        i++;
    }
    text += "----------------------------------------------\r\n";
	cm.sendOk(text);
    cm.dispose();
			break;
		case 4: //  BOSS门票
		var log = cm.getConnection().prepareStatement("SELECT * FROM BossJiShi where bossid = 14 ORDER BY shijian LIMIT 10").executeQuery();
    var text = ""
    var i = 1;
    text += "#d#e单人模式[进阶血腥女王]挑战名单（用时最少前10条）#k\r\n---------------------------------------------\r\n"
    while (log.next()) {
        text += "#fUI/UIToolTip.img/Item/Equip/Star/Star# #r" + log.getString("charname") + "#k 打败 #b" + log.getString("bossname") + "#k 使用了 " + log.getString("shijian") + "秒。"
        text += "\r\n"
        i++;
    }
    text += "----------------------------------------------\r\n";
	cm.sendOk(text);
    cm.dispose();
					break;
		case 5: //  充值奖励
		var log = cm.getConnection().prepareStatement("SELECT * FROM BossJiShi where bossid = 15 ORDER BY shijian LIMIT 10").executeQuery();
    var text = ""
    var i = 1;
    text += "#d#e单人模式[进阶贝伦]挑战名单（用时最少前10条）#k\r\n---------------------------------------------\r\n"
    while (log.next()) {
        text += "#fUI/UIToolTip.img/Item/Equip/Star/Star# #r" + log.getString("charname") + "#k 打败 #b" + log.getString("bossname") + "#k 使用了 " + log.getString("shijian") + "秒。"
        text += "\r\n"
        i++;
    }
    text += "----------------------------------------------\r\n";
	cm.sendOk(text);
    cm.dispose();
			break;
		case 6: //  排位奖励
		var log = cm.getConnection().prepareStatement("SELECT * FROM BossJiShi where bossid = 16 ORDER BY shijian LIMIT 10").executeQuery();
    var text = ""
    var i = 1;
    text += "#d#e单人模式[普通斯乌]挑战名单（用时最少前10条）#k\r\n---------------------------------------------\r\n"
    while (log.next()) {
        text += "#fUI/UIToolTip.img/Item/Equip/Star/Star# #r" + log.getString("charname") + "#k 打败 #b" + log.getString("bossname") + "#k 使用了 " + log.getString("shijian") + "秒。"
        text += "\r\n"
        i++;
    }
    text += "----------------------------------------------\r\n";
	cm.sendOk(text);
    cm.dispose();
			break;
		case 7: //  每日送点
		var log = cm.getConnection().prepareStatement("SELECT * FROM BossJiShi where bossid = 17 ORDER BY shijian LIMIT 10").executeQuery();
    var text = ""
    var i = 1;
    text += "#d#e单人模式[戴米安]挑战名单（用时最少前10条）#k\r\n---------------------------------------------\r\n"
    while (log.next()) {
        text += "#fUI/UIToolTip.img/Item/Equip/Star/Star# #r" + log.getString("charname") + "#k 打败 #b" + log.getString("bossname") + "#k 使用了 " + log.getString("shijian") + "秒。"
        text += "\r\n"
        i++;
    }
    text += "----------------------------------------------\r\n";
	cm.sendOk(text);
    cm.dispose();
			break;
		case 11: //  金币换点
		var log = cm.getConnection().prepareStatement("SELECT * FROM BossJiShi where bossid = 1 ORDER BY shijian LIMIT 30").executeQuery();
    var text = ""
    var i = 1;
    text += "#d#e组队模式[困难麦格纳斯]挑战名单（用时最少前30条）#k\r\n---------------------------------------------\r\n"
    while (log.next()) {
        text += "#fUI/UIToolTip.img/Item/Equip/Star/Star# #r" + log.getString("charname") + "#k 打败 #b" + log.getString("bossname") + "#k 使用了 " + log.getString("shijian") + "秒。"
        text += "\r\n"
        i++;
    }
    text += "----------------------------------------------\r\n";
	cm.askText(text,999,999);
    cm.dispose();
			break;
		case 12: //  纹章
		var log = cm.getConnection().prepareStatement("SELECT * FROM BossJiShi where bossid = 2 ORDER BY shijian LIMIT 30").executeQuery();
    var text = ""
    var i = 1;
    text += "#d#e组队模式[进阶半半]挑战名单（用时最少前30条）#k\r\n---------------------------------------------\r\n"
    while (log.next()) {
        text += "#fUI/UIToolTip.img/Item/Equip/Star/Star# #r" + log.getString("charname") + "#k 打败 #b" + log.getString("bossname") + "#k 使用了 " + log.getString("shijian") + "秒。"
        text += "\r\n"
        i++;
    }
    text += "----------------------------------------------\r\n";
	cm.askText(text,999,999);
    cm.dispose();
			break;
		case 13: //  金币换点
		var log = cm.getConnection().prepareStatement("SELECT * FROM BossJiShi where bossid = 3 ORDER BY shijian LIMIT 30").executeQuery();
    var text = ""
    var i = 1;
    text += "#d#e组队模式[进阶皮埃尔]挑战名单（用时最少前30条）#k\r\n---------------------------------------------\r\n"
    while (log.next()) {
        text += "#fUI/UIToolTip.img/Item/Equip/Star/Star# #r" + log.getString("charname") + "#k 打败 #b" + log.getString("bossname") + "#k 使用了 " + log.getString("shijian") + "秒。"
        text += "\r\n"
        i++;
    }
    text += "----------------------------------------------\r\n";
	cm.askText(text,999,999);
    cm.dispose();
			break;
		case 14: //  金币换点
		var log = cm.getConnection().prepareStatement("SELECT * FROM BossJiShi where bossid = 4 ORDER BY shijian LIMIT 30").executeQuery();
    var text = ""
    var i = 1;
    text += "#d#e组队模式[进阶血腥女王]挑战名单（用时最少前30条）#k\r\n---------------------------------------------\r\n"
    while (log.next()) {
        text += "#fUI/UIToolTip.img/Item/Equip/Star/Star# #r" + log.getString("charname") + "#k 打败 #b" + log.getString("bossname") + "#k 使用了 " + log.getString("shijian") + "秒。"
        text += "\r\n"
        i++;
    }
    text += "----------------------------------------------\r\n";
	cm.askText(text,999,999);
    cm.dispose();
			break;
		case 15: //  金币换点
		var log = cm.getConnection().prepareStatement("SELECT * FROM BossJiShi where bossid = 5 ORDER BY shijian LIMIT 30").executeQuery();
    var text = ""
    var i = 1;
    text += "#d#e组队模式[进阶贝伦]挑战名单（用时最少前30条）#k\r\n---------------------------------------------\r\n"
    while (log.next()) {
        text += "#fUI/UIToolTip.img/Item/Equip/Star/Star# #r" + log.getString("charname") + "#k 打败 #b" + log.getString("bossname") + "#k 使用了 " + log.getString("shijian") + "秒。"
        text += "\r\n"
        i++;
    }
    text += "----------------------------------------------\r\n";
	cm.askText(text,999,999);
    cm.dispose();
			break;
		case 16: //  金币换点
		var log = cm.getConnection().prepareStatement("SELECT * FROM BossJiShi where bossid = 6 ORDER BY shijian LIMIT 30").executeQuery();
    var text = ""
    var i = 1;
    text += "#d#e组队模式[普通斯乌]挑战名单（用时最少前30条）#k\r\n---------------------------------------------\r\n"
    while (log.next()) {
        text += "#fUI/UIToolTip.img/Item/Equip/Star/Star# #r" + log.getString("charname") + "#k 打败 #b" + log.getString("bossname") + "#k 使用了 " + log.getString("shijian") + "秒。"
        text += "\r\n"
        i++;
    }
    text += "----------------------------------------------\r\n";
	cm.askText(text,999,999);
    cm.dispose();
			break;
		case 17: //  金币换点
		var log = cm.getConnection().prepareStatement("SELECT * FROM BossJiShi where bossid = 7 ORDER BY shijian LIMIT 30").executeQuery();
    var text = ""
    var i = 1;
    text += "#d#e组队模式[戴米安]挑战名单（用时最少前30条）#k\r\n---------------------------------------------\r\n"
    while (log.next()) {
        text += "#fUI/UIToolTip.img/Item/Equip/Star/Star# #r" + log.getString("charname") + "#k 打败 #b" + log.getString("bossname") + "#k 使用了 " + log.getString("shijian") + "秒。"
        text += "\r\n"
        i++;
    }
    text += "----------------------------------------------\r\n";
	cm.askText(text,999,999);
    cm.dispose();
			break;
			cm.dispose();
         }
    }
}